<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2012.03.17.
   家居商家基本资料控制器($小牛New $2014.07.28)*/

!defined('Q_PATH') && exit;

class JiajucompanycontentController extends AController{

	public function init__(){
		$this->_arrNotMethod=array(
			'save_previewstatus',
			'save_preview',
			'view_preview',
			'foreverdelete',
			'foreverdelete_deep',
			'input_change_ajax',
			'input_change_unique',
			'forbid',
			'closeitem',
			'openitem',
			'resume',
			'clear_recycle',
			'save_sort',
			'insert',
			'add',
			'edit',
			'update'
		);
		
		parent::init__();
	}
	
	public function index($sName=null,$bDisplay=true){
		$oJiajucompanycontent=JiajucompanycontentModel::F()->where(array('jiajucompany_id'=>$GLOBALS['_company_']['jiajucompany_id']))->getOne();

		$this->assign('oJiajucompanycontent',$oJiajucompanycontent);
		$this->display();
	}

	public function content(){
		$oJiajucompanycontent=JiajucompanycontentModel::F()->where(array('jiajucompany_id'=>$GLOBALS['_company_']['jiajucompany_id']))->getOne();

		// 保存简介
		if($this->isPost()){
			$oJiajucompanycontent->save('update');
			if($oJiajucompanycontent->isError()){
				$this->E($oJiajucompanycontent->getErrorMessage());
			}else{
				$this->S('商家简介保存成功');
			}
		}

		$this->assign('oJiajucompanycontent',$oJiajucompanycontent);
		$this->display();
	}

}
